package com.citycloud.ccuap.tc.admin.config;

import java.io.Serializable;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import lombok.Data;

/**
 * SecurityConfig
 */
@Data
@Component("SecurityConfig")
@ConfigurationProperties(prefix = "security", ignoreInvalidFields = true)
public class SecurityConfig implements Serializable {
	private Oauth2 oauth2;

	@Data
	public static class Oauth2 {

		private SecurityOauth2ClientConfig client;

		private SecurityOauth2ResourceConfig resource;

	}

	/**
	 * yml配置client
	 */
	@Data
	public static class SecurityOauth2ClientConfig {
		private String clientId;
		private String clientSecret;
		private String address;
		private String accessTokenUri;
		private String userAuthorizationUri;
		private String userGetUserInfo;
		private String userLogout;

	}

	/**
	 * yml配置resource
	 */
	@Data
	public static class SecurityOauth2ResourceConfig {
		private String tokenInfoUri;
		private String id;
	}

}
